home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / marionettemadness.swf / scripts / frame_1 / DoAction_2.as next >
Text File  |  2007-10-01  |  1KB  |  62 lines

  1. function inumerateObjects(thisOBJ, level)
  2. {
  3.    for(i in thisOBJ)
  4.    {
  5.       var _loc1_ = "";
  6.       if(i != "_type")
  7.       {
  8.          j = 0;
  9.          while(j < level)
  10.          {
  11.             _loc1_ += "-->";
  12.             j++;
  13.          }
  14.          _loc1_ += i;
  15.          if(thisOBJ[i]._type != undefined)
  16.          {
  17.             _loc1_ += " (" + thisOBJ[i]._type + ")";
  18.          }
  19.          if(!(thisOBJ[i] instanceof Object))
  20.          {
  21.             _loc1_ += " = " + thisOBJ[i];
  22.          }
  23.          trace(_loc1_);
  24.       }
  25.       inumerateObjects(thisOBJ[i],level + 1);
  26.    }
  27. }
  28. function checkDataLoad(tgtObj)
  29. {
  30.    var _loc2_ = _root.xmlDataContainer[tgtObj];
  31.    inumerateObjects(_loc2_,0);
  32. }
  33. function getXMLObj(url, tgtObj, outXML, callback)
  34. {
  35.    trace("getting XML Object:");
  36.    var _loc3_ = new XML2();
  37.    delete _root.xmlDataContainer[tgtObj];
  38.    XMLLoaded = false;
  39.    _loc3_.onLoad = function(success)
  40.    {
  41.       if(success)
  42.       {
  43.          _root.xmlDataContainer[tgtObj] = new XML2Object().parseXML(this);
  44.          callback();
  45.       }
  46.       else
  47.       {
  48.          trace("error loading " + tgtObj);
  49.       }
  50.    };
  51.    if(outXML == undefined)
  52.    {
  53.       _loc3_.load(url);
  54.    }
  55.    else
  56.    {
  57.       outXML.load(url,_loc3_);
  58.    }
  59. }
  60. _root.xmlDataContainer = new Object();
  61. trace(_root.xmlDataContainer);
  62.